package exabase.data;

import java.io.Serializable;

public class Hash implements Comparable<Hash>, Serializable {
	private static final long serialVersionUID = 892712467463878498L;

	protected String md5checksum;

	public Hash(String md5checksum) {
		this.md5checksum = md5checksum;
	}

	public String toString() {
		return md5checksum;
	}

	public boolean equals(Object other) {
		if (this == other)
			return true;
		if (!(other instanceof Hash))
			return false;
		Hash otherHash = (Hash) other;
		return this.md5checksum.equals(otherHash.md5checksum);
	}

	public int hashCode() {
		return md5checksum.hashCode();
	}

	@Override
	public int compareTo(Hash other) {
		return this.md5checksum.compareTo(other.md5checksum);
	}
}
